<!--
 * @Author: your name
 * @Date: 2022-04-02 14:12:10
 * @LastEditTime: 2022-04-02 14:14:41
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \geyao\geyao\圣杯布局220402.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>圣杯布局</title>
</head>
<style>
  
  #container {
    padding-left: 200px;
    padding-right: 150px;
    overflow: auto;
  }

  #container p {
    float: left;
  }

  .center {
    width: 100%;
    background-color: lightcoral;
  }

  .left {
    width: 200px;
    position: relative;
    left: -200px;
    margin-left: -100%;
    background-color: lightcyan;
  }

  .right {
    width: 150px;
    margin-right: -150px;
    background-color: lightgreen;
  }

  .clearfix:after {
    content: "";
    display: table;
    clear: both;
  }
</style>

<body>
  <!-- 三栏布局，中间一栏最先加载和渲染（内容最重要，这就是为什么还需要了解这种布局的原因）。
两侧内容固定，中间内容随着宽度自适应。 -->
  <div id="container" class="clearfix">
    <p class="center">我是中间</p>
    <p class="left">我是左边</p>
    <p class="right">我是右边</p>
  </div>

</body>

</html>